home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 276-300 / disk_280 / cm / cm.doc < prev    next >
Text File  |  1992-05-06  |  10KB  |  304 lines

  1.  
  2.  
  3.                 CM
  4.  
  5.             Celestial Mechanics Simulator
  6.                 Version 1.0
  7.  
  8.  
  9.                W. John Guineau
  10.                3 Royal Crest Drive #9
  11.             Marlboro, Mass 01752
  12.                (508) 485-6233
  13.  
  14.  
  15.  
  16.                   NOTICE
  17.                   ------
  18.  
  19.   I have placed this software in the Public Domain with the
  20. condition that all the files remain together and that I remain
  21. listed as the original author. This software may not be used for
  22. commercial purposes or to make money in any way without expressed
  23. written permission from the author (me). I'm including the source
  24. code so if you make any significant modifications please concider
  25. sending me a copy at the above address. I'd also be interested in
  26. any interesting saved setup files you create.
  27.  
  28.  
  29. This is my first Amiga program so I welcome any comments at all.
  30. I wrote this program as both a way to learn the Amiga environment
  31. and in response to a conversation I had with a friend on Celestial
  32. Mechanics.
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.                 What is it?
  40.                 -----------
  41.  
  42. CM is a Celestial Mechanics simulation tool. It allows you to
  43. construct a layout of Masses (called Bodys) and specify various
  44. parameters concerning both the bodys and the simulation. All input
  45. is accomplished through a fully intuitionized interface. CM then
  46. proceeds to animate the bodys according to the laws of gravational
  47. attraction ( F = Gm1m2/r^2 ).  Setups may be saved to disk to allow
  48. you later re-inact interesting scenarios.
  49.  
  50.  
  51.  
  52.  
  53.               Getting Started
  54.               ---------------
  55.  
  56. CM can be run from either the CLI or from workbench by double
  57. clicking it's icon. In order for you to get a quick start, I've
  58. included some interesting setup files (described below). Just run
  59. CM and select LoadData from the FILE menu. Enter the name of the
  60. saved simulation you want and hit return (or click OK in the file
  61. requestor).
  62.  
  63. Next select START from the CONTROL menu. That's it!
  64.  
  65. Here are the included setups:
  66.  
  67. 3BODY.DAT - This is a setup of 3 bodys (no kidding!). One is a
  68. very (relativly) massive body which is not moving. The other two
  69. are much smaller and have initial velocities - one in a close
  70. orbit, the other in a larger orbit. What makes this interesting is
  71. that on several occasions the two get close enough to affect
  72. eachothers orbit. Then after about t=1400, they swap orbits.
  73.  
  74. FIXED1.DAT - This is an example of a feature in creating bodys
  75. where they can be "fixed" in place (i.e. not allowed to move).
  76. While this is not possible in reality, it makes for some interesting
  77. effects (and gives a good control on single body experiments).
  78.  
  79. FIXED2.DAT - Another fixed body example. Watch this one around
  80. t=1700!
  81.  
  82.  
  83. SVEM.DAT - This stands for SUN, VENUS, EARTH, MARS. It's a scale
  84. experiment of (guess what) the inner planets. While the masses,
  85. velocities and distances are correct, I don't quite have the
  86. initial directions just right (although it does indeed take the
  87. Earth 365 days to complete an orbit, as well as the other planets
  88. are quite close to thier orbital period). This is a good example for
  89. scaling time and distance.
  90.  
  91. SMVEM.DAT - Another like above. SUN, MERCURY, VENUS, EARTH, MARS.
  92.  
  93.  
  94.  
  95.  
  96.              How to use CM
  97.              -------------
  98.  
  99. CM is really pretty easy to use. You first need to decide on what
  100. you want to simulate. Then decide on an appropriate scale for
  101. both distance and time.
  102.  
  103. The visible universe is made up of 635 units in the x direction
  104. and 377 units in the y direction. I say units instead of pixels
  105. because CM lets you assign any arbitrary scale to the distance
  106. between each pixel. Calculations are based on the scaled distance and on
  107. scaled time. CM lets you specify an arbitrary amount of time for each
  108. iteration of the simulation.
  109.  
  110. The non-visible universe extends virtually infinetly in all
  111. directions (2D space).
  112.  
  113. To see how scaling is useful concider the 3BODY.DAT example
  114. (described above). It has a distance scale of 1:1 and a time scale
  115. of 0.5. Which brings up another useful variable to set - G. G is the
  116. gravational constant and is, in reality, equal to 6.67E-11. CM
  117. lets you specify what G is for the calculations. 3BODY.DAT uses
  118. just 6.67 for G, pretty amazing, huh? :-0.
  119.  
  120. Now contrast 3BODY's settings with those of SVEM.DAT. This is a
  121. real scale model. The distance scale is 1E6, which just happens
  122. to work nicely for distances in KiloMeters from the SUN to the inner
  123. planets. The time scale is 8.64E4. What is that?? It's the number of
  124. seconds in one day. G is set to 6.67E-8, which is appropriate
  125. for the KiloMeter scaling of distance. Since the units for G are
  126. based on 1 second, time scaling must also be based on 1 second -
  127. hence, 1 day in seconds. This means that for each iteration of the
  128. simulation, one day goes by and by placing the Earth body 150
  129. units (pixels) away from the SUN's location, it's really 150E6
  130. kilometers away (it's correct mean distance). Ij addition to
  131. distance and time, you should use units for Mass and Velocity
  132. that are consistant with everything. Get the idea?
  133.  
  134.  
  135. The best things to do are get a good book with real numbers and
  136. experiment. Eventually you'll get the feel for the scaling and
  137. how it affects the simulation.
  138.  
  139.  
  140.  
  141.  
  142.                  The Menus
  143.                  ---------
  144.  
  145. With that simple look at things, heres what the menu's do.
  146.  
  147. There are 3 main menus in the title bar: FILE, EDIT and CONTROL.
  148.  
  149.  
  150. The FILE menu has the following items.
  151.  
  152. ABOUT    - Read this one and send mail to the address listed or just
  153.       call to say hi! I'd love to hear from anyone using this
  154.       program with questions, comments or whatever.
  155.  
  156. LoadData
  157.     - This allows you to load in a previously saved setup file.
  158.       The files are pretty simple. You can type or edit them but
  159.       beware that CM expects the EXACT format they get saved in. Type
  160.       one out and see!
  161.  
  162.       Selecting this item pops up a simple file requestor asking
  163.       for the name.
  164.  
  165.  
  166. SaveData
  167.     - This allows you to save a setup. It's a good idea to
  168.       save an experiment BEFORE you run it. That way you can
  169.       reload it to modify the initial parameters.
  170.  
  171.       Selecting this item pops up a simple file requestor asking
  172.       for the name.
  173.  
  174. SaveScreen
  175.     - This item will dump the current screen to an IFF ILBM
  176.       file (for use with DPaint or whatever). CM uses a hires
  177.       interlaced, 8 color custom screen.
  178.  
  179.       This menu item is currently not implemented. If anyone is
  180.       interested I will put it in. Actually I'll do it sometime
  181.       anyway just to learn how!
  182.  
  183. EXIT    - Exits CM. The window close gadget does the same thing.
  184.  
  185.  
  186.  
  187. The EDIT menu has the following items.
  188.  
  189. Setup    - This pops up a requestor to allow you to set all the
  190.       simulation parameters. The parameters are described
  191.       below.
  192.  
  193. Create    - This puts CM into the Create Body mode. Once selected
  194.       a small window will open at the top of the screen showing
  195.       the current mouse coordinates (properly scaled). When the
  196.       mouse is where you want a body, click the left button.
  197.       A body requestor will pop up to let you fill in the
  198.       information for that body. The body requestor is described
  199.       below. You can create up to 10 bodys.
  200.  
  201. Modify    - Once you've created bodys (or loaded them in from a file)
  202.       you can step through them to view/modify their parameters.
  203.       You can also delete a body this way.
  204.  
  205. ClearScreen
  206.     - Just clears the screen. Useful when trails have
  207.       cluttered the display.
  208.  
  209. ClearBodys
  210.     - Clears all body information. A requestor will ask you if
  211.       you really want to do this.
  212.  
  213.  
  214. The CONTROL menu has the following items.
  215.  
  216. Start    - Starts a simulation. You must have bodys created to use
  217.       this item.
  218.  
  219. Stop    - Stops a simulation in progress. Setup info can then be
  220.       changed, bodys can be modified or saved and the simulation
  221.       restarted.
  222.  
  223.  
  224. The setup requestor allows you to change the following.
  225.  
  226. G    - The gravational constant. Entered as a floating point
  227.       number such as 6.67e-11.
  228.  
  229. Sim Time
  230.     - This is the time scaling for each iteration of the
  231.       simulation. Specified as a floating point number.
  232.  
  233. Real Time
  234.     - Normally the simulator runs at full speed. Putting a value
  235.       other than zero here inserts a real delay, in miliseconds,
  236.       between each iteration. Maybe useful for 68020/68030 users.
  237.       Specified as an integer.
  238.  
  239. Units/Pixel
  240.     - This is the distance scale. It specifies the distance
  241.       between pixels. Specified as a floating point number.
  242.  
  243. TrailLength
  244.     - This decides how a bodys trail is dealt with.
  245.       A value of ZERO means leave no trail.
  246.       A value of -1 means leave an infinite trail.
  247.       A value between 1 and 300 specifies the number of
  248.         past locations to save. This creates worm like
  249.         trails behind a body.
  250.  
  251. ShowTime
  252.     - If YES, the integer number of iterations will be displayed
  253.       during the simulation. This number can then be multiplied
  254.       by the time scale for real time. In some cases, such as
  255.       with the SVEM and SMVEM examples, it can be read directly
  256.       as days.
  257.  
  258.  
  259. The Body requestor allows you to specify the following
  260. characteristics of a body.
  261.  
  262. NAME    - This is a name you give it (such as SUN, EARTH etc.)
  263.  
  264.  
  265. MASS    - This is it's mass. Entered as a floating point number.
  266.       The units you use should be consistant with the rest
  267.       of the setup information (i.e. G, scaling, velocity etc)
  268.  
  269. VELOCITY
  270.     - The scalar velocity of the body. Floating point. Should
  271.       be dimensionally consistant with the rest of the setup
  272.       info.
  273.  
  274. DIRECTION
  275.     - The angle of the velocity in degrees. 0 degrees is due
  276.       east with 90 strait up, 180 due west and 270 due south.
  277.       Integer number.
  278.  
  279. COLOR    - Clicking on a color will set the bodys color.
  280.  
  281.  
  282. FIXED    - YES means the body can't move. While this is not "real",
  283.       it can be useful for experimentation.
  284.  
  285.  
  286. The bodys current location is displayed below the FIXED gadget.
  287.  
  288.  
  289. In both the SETUP and the BODY requestors, clicking on OK accepts
  290. the values, RESET sets them to their defaults and CANCEL quits the
  291. operation without any changes. In addition the BODY requestor will
  292. display DELETE in place of CANCEL during a MODIFY operation.
  293. Selcecting this will delete the body from the simulation.
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.